package com.xiaolin.security.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName ViewController
 * @Description TODO
 * @Detail detail
 * @Author MyPC
 * @Date 2020/10/8
 * @Version 1.0
 */
@Controller
@RequestMapping("/view")
public class ViewController {

    @PreAuthorize("hasAnyRole('admin','common')")
    @RequestMapping("/admin")
    public String admin(){
        return "admin";
    }
    @PreAuthorize("hasRole('super')")
    @RequestMapping("/super")
    public String superPage(){
        return "super";
    }
}
